<?php

use Johnm\Probackend\Asset\Asset;

// Register all css file
foreach (array_reverse(Config::get('probackend::config.assets.css', array())) as $cssFile) {
    Asset::addFirst('/packages/johnm/probackend/' . $cssFile);
}


// Register all js file
foreach (Config::get('probackend::config.assets.js', array()) as $jsFile) {
    Asset::add('/packages/johnm/probackend/' . $jsFile, "core");
}
$modules = config("probackend::config.modules", array());
$prefix = config('probackend::config.sites.prefix');
define("PACKAGE_RESOURCE_PATH", "/packages/johnm/probackend/");
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>{{translate($modules[Request::segment(2)]['title'])}}</title>
        <?php Asset::css() ?>
    </head>
    <body class="sidebar-wide">
        @include("probackend::layouts.header")  
        <div class="page-container">
            @include("probackend::layouts.sidebar") 
            <div class="page-content"> 
                {{$content}}
            </div>
        </div> 
    <?php Asset::js("core") ?>
    <?php Asset::js("footer") ?>
    <?php Asset::scripts() ?>
    <script>
<?= View::make("probackend::behavior.scripts", ["needCrub" => $needCrub]) ?>
    </script>
</body>
</html>
